from codex import * import random from time import sleep dice = [1,2,3,4,5,6] display.print('Roll the Dice', color=BLUE, scale=3, cursor_y=3) display.print("press A", color=GREEN, scale=3, cursor_x=3, cursor_y=5) sleep(2) display.clear() while True: # Pick a random color from COLOR_LIST index = random.randrange( len(COLOR_LIST) ) color = COLOR_LIST[index] pixels.set(0, random.choice(COLOR_LIST)) pixels.set(1, random.choice(COLOR_LIST)) pixels.set(2, random.choice(COLOR_LIST)) pixels.set(3, random.choice(COLOR_LIST)) if buttons.was_pressed(BTN_A): display.print(random.choice(dice), color=PURPLE, scale=10) sleep(1) display.clear()